<!DOCTYPE html>
<html>
<head>
    <@h.head />
	<title></title>
	<script type="text/javascript">
	function showDataPage(index, row){
		$('#dataPage').panel({
			title: "[<a href='${ctx}/data/edit/" + row.id + "' target='_blank'> 添加 </a>]&nbsp;&nbsp;"+row.name ,
		    href:'${ctx}/html/smartform/dataPage?templateId=' + row.id + '&templateName=' + row.name,
		    onLoad:function(){
		    }
		});
	}
	</script>
</head>

<body class="easyui-layout">

<!-- 左边 -->
<div data-options="region:'west',title:'模板',split:true" style="width:600px;">
	
	<table id="dgTemplate" class="easyui-datagrid" style="width:100%;" toolbar="#tbAction"
		data-options="singleSelect:true, onClickRow:showDataPage,
			url: '${ctx}/smartform/template/list',
			">
		<thead>
			<tr>
				<th data-options="field:'id',hidden:true">id</th>
				<th data-options="field:'name',width:'20%'">模板名称</th>
			</tr>
		</thead>
	</table>
	<div id="tbAction">
		<#if (template.id)??>
		    <a href="${ctx}/smartform/config/template/${template.id}/action/edit" class="easyui-linkbutton" iconCls="icon-add" plain="true" target="_blank">新增</a>
		    <a href="#" class="easyui-linkbutton" iconCls="icon-save" plain="true" onclick="javascript:saveAction()">保存</a>
		    <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="javascript:deleteAction()">删除</a>
	    </#if>
	</div>

</div>

<!-- 右边 -->
<div id="dataPage" data-options="region:'center'" style="padding:5px;background:#eee;">
	
</div>

</body>
</html>
